<template>
  <button classs="s-button" @click="handleClick">
    <slot></slot>
  </button>
</template>

<script>
import Emitter from "../../mixin/emitter";
export default {
  name: "SButton",
  componentName: "SButton",
  mixins: [Emitter],
  data() {
    return {
      // testJsonString :'{"name":"铁拐李"}'
    };
  },
  created() {},
  mounted() {
    //监听自定义事件 test,并传值
    // this.$on('test',(val)=>{
    //   console.log('打印自定义事件传过来的内容',val)
    // })
  },
  methods: {
    handleClick(event) {
      // 在当前组件上触发自定义事件 test，并传值
      // this.$emit('test', 'Hello Vue.js')
      // this.dispatch('Home','test1','子组件像上转发传值')
      this.$emit("click", event);
    }
  }
};
</script>

<style>
</style>